#!/usr/bin/env python
# coding: utf-8

import McTwo
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler


def get_data():
    data = pd.read_csv("./p2pData.txt", sep=" ", header=None)
    label = pd.read_csv("./p2pLabel.txt", sep=" ", header=None)
    data_columns = data.shape[1]

    for i in range(0, data_columns):
        if data[i][0] != data[i][0]:
            del data[i]

    data_columns = data.shape[1]
    data.columns = np.arange(0, data_columns)

    return data, label


data, label = get_data()
scaler = StandardScaler()
data = scaler.fit_transform(data)

data = np.array(data)
label = np.array(label)
label = np.reshape(label, label.shape[0])

selectedFeatureList = McTwo.McTwo(data, label)
#selectedFeatureList = [i - 1 for i in selectedFeatureList]
print(selectedFeatureList)

